<template>
	<view>
		<view class="ra15 bgffff  pg25">
			<view class="flex-ju-b">
				<view class="flex-ju-a flex1">
					<view @click="taplist(index)" :class="{color0E74CF:tindex==index}" v-for="(item,index) in ['正在申报','正在公示','新发文件']">{{item}}</view>
				</view>
			</view>
		</view>
		<view  class="con">
			<view v-if="isdata" class="flex-ju-c color999 mt10vh">
				暂无数据
			</view>
			<template v-if="tindex==0" v-for="(item,index) in list" :key="index">
				<template v-if="index<4">
					<view  @click="navto('/pages/user/recoer_detail?id='+item.id)" class="flex-ju-b  mt30  " >
						<view  class=" ">
							<view class="flex-a-i">
								<!-- <view class="bg0E74CF ra10 wh10-40"></view> -->
								<view class="size24 colorB8B8B8 ">{{item.create_time}}</view>
							</view>
							<view class="size24 mt15">
								地区：{{item.company.province}} {{item.company.area}} {{item.company.city}}
							</view>
							<view class="size24 mt15">
								申报企业：{{item.company.name}}
							</view>
						</view>
						<view class="size26">
							{{item.status_name}}
						</view>
					</view>
				</template>
			</template>
			<view v-else v-for="(item,index) in infolist" @click="navto('./news_detail')" class="flex-a-i mt30">
				<view>
					<image :src="item.image_input[0]" class="wh220-140 ra10"></image>
				</view>
				
				<view  class="ml20">
					<view class="one size30 mt15">{{item.title}}</view>
					<view class="one size25 colorB8B8B8 mt5">{{item.synopsis}}</view>
					<view class="size20 colorB8B8B8 mt5">{{item.add_time}}</view>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isdata:false,
				tindex:0,
				page:1,
				infolist:[],
				list:[]
			}
		},
		onReachBottom() {
			this.page++
			this.getlist()
		},
		onLoad(option) {
			this.getlist()
		},
		methods: {
			taplist(index){
				this.page=1
				this.infolist=[]
				this.tindex =index
				this.getlist()
			},
			getlist(){
				if(this.tindex==1){
					this.http('/article/list/1',{limit:15,page:this.page}).then(res=>{
						this.infolist = [...this.infolist,...res.data]
						if(this.infolist.length){
							this.isdata = false
						}else{
							this.isdata = true
						}
					})
				}else if(this.tindex==2){
					this.http('/article/list/4',{limit:15,page:this.page}).then(res=>{
						this.infolist = [...this.infolist,...res.data]
						if(this.infolist.length){
							this.isdata = false
						}else{
							this.isdata = true
						}
					})
				}else{
					this.http('company/apply_list',{status:0,limit:4}).then(res=>{
						this.list=res.data.list
						if(this.list.length){
							this.isdata = false
						}else{
							this.isdata = true
						}
					}).catch(res=>{
						if(this.list.length){
							this.isdata = false
						}else{
							this.isdata = true
						}
					})
				}
				
			}
		}
	}
</script>

<style>
 .color0E74CF{
		 color: #0E74CF;
		 font-weight: bold;
	 }
</style>
